#include<bits/stdc++.h>
using namespace std;
int n;
int a[100010];
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for(int i = 1; i <= n; i++){
        scanf("%d", &a[i]);
    }
    sort(a+1, a+n+1);
    int pre=a[n], cntn=1, ans=n, cntp=0;
    for(int i = n-1; i >= 1; i--){
        if(a[i]<a[i+1]){
            cntp+=cntn;
            //cout << cntn << endl;
            cntn=0;
        }
        cntn++;
        if(cntp){
            cntp--;ans--;
        }
    }
    printf("%d\n", ans);
    return 0;
}
